<template>
	<view class="search-page">
		<search :disabled="false" />
		<view class="list-page">
			<view class="list-container">
				<template v-if="searchMyTaskDataRow">
					<item v-for="(item, index) of searchMyTaskData" :key="index" :data="item" />
				</template>
				<empty v-else type="task"/>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState, mapMutations } from 'vuex'
	import { myTask } from "@/api/task"
	import search from '../components/search-bar'
	import item from './item'
	export default {
		components: {
			search,
			item
		},
		computed: {
			...mapState(['searchMyTaskData', 'searchMyTaskDataRow'])
		},
		methods: {
			...mapMutations(['searchMyTask', 'searchMyTaskRow'])
		},
		beforeDestroy() {
			this.searchMyTask([])
			this.searchMyTaskRow(1)
		}
	}
</script>
